using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Storage;
using Microsoft.Xna.Framework.GamerServices;
+using Microsoft.Xna.Framework.Media;
+using Microsoft.Xna.Framework.Audio;
using SuperPolarity;
#endregion
Screen EntryScreen;
- SpriteFont DebugFont;
+ protected Song TitleSong;
+ protected Song GameSong;
+ protected SoundEffect GameOverSound;
public SuperPolarity()
: base()
ActorManager.SetGame(this);
ScreenManager.SetGame(this);
- EntryScreen = (Screen)new GameScreen(this);
+ EntryScreen = (Screen)new TitleScreen(this);
}
/// <summary>
InputController.Bind("fullScreenToggle", HandleFullScreenToggle);
EntryScreen.Initialize();
- ScreenManager.Push(EntryScreen);
OutlierBounds = 100;
}
/// </summary>
protected override void LoadContent()
{
+
+ MediaPlayer.IsRepeating = true;
+ GameSong = Content.Load<Song>("Sound\\polaritytheme.wav");
+ GameOverSound = Content.Load<SoundEffect>("Sound\\gameover");
+
// Create a new SpriteBatch, which can be used to draw textures.
spriteBatch = new SpriteBatch(GraphicsDevice);
- EntryScreen.LoadContent();
+ ScreenManager.Push(EntryScreen);
- Player = new Player();
- DebugFont = Content.Load<SpriteFont>("Fonts\\SegoeUIMono14");
+ Player = new Player(this);
}
/// <summary>
ScreenManager.Update(gameTime);
+ Player.Update();
+
base.Update(gameTime);
}
ScreenManager.Draw(spriteBatch);
- spriteBatch.DrawString(DebugFont, "Score: " + Player.Score.ToString(), new Vector2(10, 10), Color.LightGray);
- spriteBatch.DrawString(DebugFont, "Multiplier: " + Player.Multiplier.ToString(), new Vector2(10, 30), Color.LightGray);
- spriteBatch.DrawString(DebugFont, "Lives: " + Player.Lives.ToString(), new Vector2(10, 50), Color.LightGray);
-
spriteBatch.End();
base.Draw(gameTime);
}
+
+ public void PlaySong(string songName)
+ {
+ // temp stuff before media manager is in
+ if (songName == "game")
+ {
+ MediaPlayer.Play(GameSong);
+ }
+ }
+
+ public void GameOver()
+ {
+ MediaPlayer.Stop();
+ GameOverSound.Play();
+ ScreenManager.Pop();
+ }
}
}